package com.example.designpattern.creational.factory.simple_factory;

import com.example.designpattern.creational.factory.common.product.fruit.Fruit;

public class User {
    private void eat() {
        FruitFactory fruitFactory = new FruitFactory();
        Fruit apple = fruitFactory.create("苹果");
        Fruit pear = fruitFactory.create("梨子");
        apple.eat();
        pear.eat();
    }

    public static void main(String[] args) {
        User user = new User();
        user.eat();
    }
}